const home = r => require.ensure([], () => r(require('../components/home')), 'home')
const about = r => require.ensure([], () => r(require('../components/about')), 'about')
const news = r => require.ensure([], () => r(require('../components/news')), 'news')
const news2 = r => require.ensure([], () => r(require('../components/news2')), 'news2')
const service = r => require.ensure([], () => r(require('../components/service')), 'service')
const vuexCounter = r => require.ensure([], () => r(require('../components/vuexCounter')), 'vuexCounter')
const loginDemo = r => require.ensure([], () => r(require('../components/loginDemo')), 'loginDemo')
const loginHandler = r => require.ensure([], () => r(require('../components/loginHandler')), 'loginHandler')
const tabbar = r => require.ensure([], () => r(require('../components/tabbar')), 'tabbar')
const tabbarHome = r => require.ensure([], () => r(require('../components/tabbarHome')), 'tabbarHome')
const tabbarDiscount = r => require.ensure([], () => r(require('../components/tabbarDiscount')), 'tabbarDiscount')
const tabbarCart = r => require.ensure([], () => r(require('../components/tabbarCart')), 'tabbarCart')
const tabbarUser = r => require.ensure([], () => r(require('../components/tabbarUser')), 'tabbarUser')
const test = r => require.ensure([], () => r(require('../components/test')), 'test')
const accordion = r => require.ensure([], () => r(require('../components/accordion')), 'accordion')

export default [
  {path: '/', redirect: '/home'},
  {path: '/index',  redirect: '/home'},
  {path: '/home',component: test},
  {path: '/about',component: about},
  {path: '/news',component: news},
  {path: '/news2',component: news2},
  {path: '/service',component: service},
  {path: '/vuexCounter',component: vuexCounter},
  {path: '/loginDemo',component: loginDemo},
  {path: '/loginHandler',component: loginHandler},
  {path: '/test',component: test},
  {path: '/accordion',component: accordion},
  { 
    path: '/tabbar', 
    component: tabbar,
    redirect: '/tabbar/tabbarHome',
    children: [
      { path: 'tabbarHome', component: tabbarHome },
      { path: 'tabbarDiscount', component: tabbarDiscount },
      { path: 'tabbarCart', component: tabbarCart },
      { path: 'tabbarUser', component: tabbarUser }
    ]
  }
]
